#ifndef _messages
#define _messages

#include <iostream>

//#include "node.h"
#include "link.h"
#include "table.h"
/*
#if defined(GENERIC)
struct RoutingMessage {
 public:
  ostream & Print(ostream &os) const;
};
#endif
*/
#if defined(LINKSTATE)
class RoutingMessage {
public:
	unsigned src, dest;
	int age,cost;
  RoutingMessage();
  RoutingMessage(int a, int c, int s, int d){
	  age = a; cost = c; src = s; dest = d;
  };
  RoutingMessage(const RoutingMessage &rhs);
  RoutingMessage &operator=(const RoutingMessage &rhs);

  ostream & Print(ostream &os) const;
};
#endif

#if defined(DISTANCEVECTOR)
class RoutingMessage {
public:
	unsigned src;
	map<int,BestHop> shortest;
 RoutingMessage();
 RoutingMessage(unsigned s, map<int,BestHop> best){
	  src = s;
	  shortest = best;
  }
  RoutingMessage(const RoutingMessage &rhs);
  RoutingMessage &operator=(const RoutingMessage &rhs);

  ostream & Print(ostream &os) const;
};
#endif


inline ostream & operator<<(ostream &os, const RoutingMessage &m) { return m.Print(os);}

#endif
